package com.mlethe.library.multi.api.entity;

import android.text.TextUtils;

import com.mlethe.library.multi.api.MultiMedia;
import com.mlethe.library.multi.api.Platform;

import org.json.JSONObject;

/**
 * 平台配置
 */
public final class PlatformConfig implements Platform {
    /**
     * 平台appId
     */
    private String appId = null;
    /**
     * 平台secret
     */
    private String secret = null;
    /**
     * 其他信息
     */
    private String other = null;
    /**
     * 平台
     */
    private final MultiMedia media;

    public PlatformConfig(MultiMedia media) {
        this.media = media;
    }

    @Override
    public MultiMedia getName() {
        return this.media;
    }

    @Override
    public void parse(JSONObject json) {
    }

    @Override
    public boolean isConfigured() {
        return !TextUtils.isEmpty(this.appId);
    }

    @Override
    public void setAppId(String appId) {
        this.appId = appId;
    }

    @Override
    public String getAppId() {
        return this.appId;
    }

    @Override
    public void setAppSecret(String secret) {
        this.secret = secret;
    }

    @Override
    public String getAppSecret() {
        return this.secret;
    }

    @Override
    public void setOther(String other) {
        this.other = other;
    }

    @Override
    public String getOther() {
        return other;
    }
}
